#include "drv_seg.h"
#include "drv_spi.h"
#include "drv_systick.h"
void drv_74hc595_init(void)
{
	drv_spi2_init();
}

void drv_seg_display(uint8_t wei,uint8_t duan)
{		
		uint8_t duan_code[] = {  0x3F, 0x06,0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F,0x6F };
		uint8_t wei_code[] = { 0x01, 0x02, 0x04, 0x08 };
		
		drv_spi2_senddata(wei_code[wei]);
		
		drv_spi2_senddata(duan_code[duan]);
	
		GPIO_ResetBits( GPIOB,  GPIO_Pin_12);
		drv_systick_ms(2);
		GPIO_SetBits( GPIOB, GPIO_Pin_12);

		
}



